<?php
	ob_start();
	include_once "../classes/baiviet_bs.php";
	include_once "../classes/thuvienham.php";
	
	if(!IsAdmin())
		header("Location: index.php");
	$MaBaiViet = $_GET['mabaiviet'];
	
	$baiviet = new baiviet_bs();
	$baiviet->SetMaBaiViet($MaBaiViet);
	
	$data_baiviet_toggle = $baiviet->LayDanhSach();
	
	if($data_baiviet_toggle[0]['DuocChinhSua'] == 1)
		$baiviet->SetDuocChinhSua(0);
	else
		$baiviet->SetDuocChinhSua(1);
	
	$kq = $baiviet->CapNhatDuocChinhSua();
	header("Location: " . $_SERVER['HTTP_REFERER']);
	ob_flush();
?>